<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/16/016
 * Time: 22:58
 */

namespace app\api\controller\v1;


use cmf\controller\HomeBaseController;
use app\api\model\VideoPostModel;

/**
 * Class ArticleController 视频控制器
 * @package app\api\controller\v1
 */
class VideoController extends HomeBaseController
{
    /**
     * 视频列表
     * @url api/v1/video/:num
     * @param $count
     * @return videoList
     */
    public function index( $num )
    {
        $videoModel = new VideoPostModel();
        $videoList = $videoModel::getMostVideo($num);
        return json($videoList);
    }

    /**
     * 视频列表
     * @url api/v1/video/:num
     * @param $count
     * @return videoList
     */
    public function getOne( $id )
    {
        $videoModel = new VideoPostModel();
        $video = $videoModel::getVideoDetail($id);
        return json($video);
    }
}